Workshop goals
- learn about various packages for making data visualizations in R
- be able to determine which package to use
- understand basic syntax for the popular packages
- learn basic design principles for effective communication
- gain hands-on practice making different visualization types
What is R?
R is a software environment for statistical computing and graphics. Using R you can do rigorous statistical analysis, clean and manipulate data, and create publication-quality graphics.
clustering map
Popular R packages for data viz
- ggplot2
- highcharter
- leaflet
- plotly
ggplot2
Source: 
highcharter
data(citytemp)
hc <- highchart() %>%
hc_xAxis(categories = citytemp$month) %>%
hc_add_series(name = "Tokyo", data = citytemp$tokyo) %>%
hc_add_series(name = "London", data = citytemp$london) %>%
hc_add_series(name = "Other city",
data = (citytemp$tokyo + citytemp$london)/2)
hc
leaflet
m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=-78.6697, lat=35.7876,
popup="You are here")
m # Print the map
plotly
p <- plot_ly(economics, x = ~date, y = ~unemploy / pop)
p
Deciding on the right package
- Do you want your visualizations to be interactive or static?
- interactive: plotly, highcharter, ggviz
- static: ggplot2
- Do you want to use R Markdown/knitr to publish your visualization?
- not ggvis (it)
- Do you want to create a dashboard for multiple vizzes?
- Are you creating your visualization for a commercial or government purpose?
- Do you need to do something sophisticated with geospatial data?